package utils;

public class StringUtil {
	
	public static Integer null2Integer(String s) {
		if (s==null || s.equals(""))
			return Integer.valueOf(0);
		else
			return Integer.parseInt(s);
	}
	
	public static Float null2Float(String s) {
		if (s==null || s.equals(""))
			return Float.valueOf(0);
		else
			return Float.parseFloat(s);
	}
	
	public static String null2String(Object x) {
		if (x == null)
			return "";
		return String.valueOf(x);
	}

}
